﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Controls;
using System.Drawing;
using Silvermoon.OpenGL;

namespace Testing
{
    public class TextDialog : Dialog
    {
        private Label label;

        public TextDialog(string text)
            : base()
        {
            Margin = new Margin { VerticalCentered = true, Left = 24, Right = 24 };
            TextColor = Color.White;
            ModalColor = Color.Black;
            Height = 340;
            //Width = 440,
            //Margin = Margin.Centered,

            Dialog dlg = this;

            dlg.Controls.Add(new DialogButton
            {
                Size = new Size(120, 64),
                Margin = new Margin(null, null, 152, 16),
                Content = "OK",
                Color = Color.DarkGreen,
            });

            dlg.Controls.Add(new DialogButton
            {
                Content = "Cancel",
                Color = Color.DarkRed,
                Size = new Size(120, 64),
                Margin = new Margin(null, null, 16, 16)
            });
            dlg.Controls.Add(new Label
            {
                Text = "Dialog",
                Font = FontSprite.Bold,
                Alignment = Alignment.Center,
                Margin = new Margin(4, 4, 4, null),
                Height = 48
            });

            label = new Label
             {
                 LineAlignment = Alignment.Near,
                 Alignment = Alignment.Center,
                 Text = text,
                 LineMode = LineMode.WordWrap,
                 Margin = new Margin(24, 64, 24, 64)
             };
            dlg.Controls.Add(label);
            dlg.ShowModal();
        }

        public string Text
        {
            get { return label.Text; }
            set
            {
                label.Text = value;
            }
        }


    }
}
